<?xml version="1.0"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>Add a private Business Rule class</Title>
      <Author>Rockford Lhotka</Author>
      <Description>Add a private Business Rule class</Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>cslarule</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal Editable="true">
          <ID>ClassName</ID>
          <ToolTip>
          </ToolTip>
          <Default>Criteria</Default>
          <Function>
          </Function>
        </Literal>
      </Declarations>
      <Code Language="csharp" Kind="type decl"><![CDATA[private class $ClassName$ : Csla.Rules.BusinessRule
  {

    // TODO: Add additional parameters to your rule to the constructor
    public $ClassName$ (IPropertyInfo primaryProperty)
      : base(primaryProperty)
    {
      // TODO: If you are  going to add InputProperties make sure to uncomment line below as InputProperties is NULL by default
      //if (InputProperties == null) InputProperties = new List<IPropertyInfo>();

      // TODO: Add additional constructor code here 



      // TODO: Marke rule for IsAsync if Execute contains asyncronous code 
      // IsAsync = true; 
    }

    protected override void Execute(RuleContext context)
    {
      // TODO: Add actual rule code here. 
      //if (broken condition)
      //{
      //  context.AddErrorResult("Broken rule message");
      //}

      if (IsAsync) context.Complete();
    }

}
]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>